//针对admin的api操作都写到该文件中
import service from "@/api/index.js";
//将所有的针对admin的请求都封装到一个对象中
const adminApi = {
    /*获取登录信息*/
    getLoginAdmin(){
        return service.get('/admin/getLogin')
            .then(response=>response.data)
    },
    /*获取登录信息*/
    login(admin){
        return service.post('/admin/login',admin)
            .then(response=>response.data)
    },
    /*获取管理员*/
    getAdmin(params){
        return service.get('/admin',{params})
            .then(response=>response.data)
    },
    /*添加管理员*/
    addAdmin(admin){
        return service.post('/admin/addAdmin',admin)
            .then(response=>response.data)
    },
    checkPhone(phone){
        return service.get('/admin/checkPhone',{params:{phone:phone}})
            .then(response=>response.data)
    },
    /*修改管理员信息*/
    modifyAdmin(admin){
        return service.post('/admin/modifyAdmin',admin)
            .then(response=>response.data)
    },
    /*删除管理员*/
    deleteAdmin(id){
        return service.get('/admin/deleteAdmin',{params:{id:id}})
            .then(response=>response.data)
    },
    /*批量删除*/
    delSelected(ids){
        return service.post('/admin/delSelected',ids)
            .then(response=>response.data)
    }

}
export default adminApi;